//
//  MyLayout.h
//  UI26_自定义layout
//
//  Created by dllo on 16/3/17.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import <UIKit/UIKit.h>


//协议
@protocol MyLayoutDelegate <NSObject>

-(CGFloat)collectionView:(UICollectionView *)collectionView heightForItemAtIndexPath:(NSIndexPath *)indexPath byWidth:(CGFloat)width;

@end

@interface MyLayout : UICollectionViewLayout

//自定义layout 就是计算每一个cell的frame(x,y,w,h)
@property(nonatomic, assign) NSInteger columnCounts;/**< 列数*/
@property(nonatomic, assign) NSInteger columnSpace;/**< 列间距*/
@property(nonatomic, assign) NSInteger rowSpace;/**< 行间距*/
@property(nonatomic, assign) UIEdgeInsets edgeInsets;/**< 边距*/
@property(nonatomic, assign) id <MyLayoutDelegate>delegate;
@end
